package com.zhang.client;

import com.zhang.entity.CartInfo;
import com.zhang.result.RetVal;
import com.zhang.search.SearchParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;


//该远程接口是由哪个微服务去实现
@FeignClient(value = "shop-cart")
public interface CartFeignClient {

    //加入购物车
    @PostMapping("/cart/addToCart/{skuId}/{skuNum}")
    public RetVal addToCart(@PathVariable Long skuId, @PathVariable Integer skuNum);

    //2.购物车列表
    @GetMapping("getCartList")
    public RetVal getCartList(HttpServletRequest request);

    //5. 查询选中的商品信息--送货清单
    @GetMapping("/cart/getSelectedCartInfo/{userId}")
    public List<CartInfo> getSelectedCartInfo(@PathVariable String userId);
}
